﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Admin_PollMg.aspx.cs" Inherits="QiCms.Web.Admin.Admin_PollMg" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script src="/template/admin/js/echarts.min.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="QBSCmsContentPlaceHolder" runat="server">
<form id="PollForm" runat="server">
<asp:Panel ID="AddPH" runat="server">
    <div class="tpl-content-wrapper">
        <ol class="am-breadcrumb">
        <li><a href="Index.aspx" class="am-icon-home">首页</a></li>
        <li><a href="Admin_Poll.aspx">投票管理</a></li>
        <li class="am-active">添加投票</li>
        </ol>
        <div class="tpl-portlet-components">
            <div class="am-g tpl-amazeui-form">
                <div class="am-form am-form-horizontal">
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">投票标题：</label>
                        <div class="am-u-sm-9">
                            <input name="VoteTitleTxt" type="text" id="VoteTitleTxt" style="width:80%;float:left;" placeholder="标题" runat="server">
                            <asp:RequiredFieldValidator ID="VoteTitleValR" runat="server" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">投票设置：</label>
                        <div class="am-u-sm-9">
                            <div class="input-icon right" style="font-size:14px;margin-top:10px;">
                                <asp:CheckBox ID="MultipleChk" runat="server" Text="多选" />
                                <asp:CheckBox ID="InIndexChk" runat="server" Text="在首页显示" />
                                <asp:CheckBox ID="CanViewChk" runat="server" Text="公开投票结果" />
                                        
                            </div>

                        </div>
                    </div>
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label" style="color:darkred;">注意：</label>
                        <div class="am-u-sm-9">
                            <div style="width:80%;float:left;margin-top:6px;color:darkred;">
                                <small>投票项目（每行为一项，最大255字）</small>
                            </div>
                        </div>
                    </div>
                            
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">投票项目：</label>
                        <div class="am-u-sm-9">
                            <textarea  name="VoteItemsTxt" id="VoteItemsTxt" style="width:90%;float:left;" rows="5" placeholder="每行为一项，最大255字" runat="server"></textarea>
                            <asp:RequiredFieldValidator ID="VoteItemsValR" runat="server" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="am-form-group">
                        <div class="am-u-sm-9 am-u-sm-push-3">
                            <asp:Button ID="PollAddBtn" CssClass="am-btn am-btn-primary tpl-btn-bg-color-success" runat="server" OnClick="PollAddBtn_Click" Text="添加"/>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</asp:Panel>
<asp:Panel ID="EditPH" runat="server">
    <div class="tpl-content-wrapper">
        <ol class="am-breadcrumb">
        <li><a href="Index.aspx" class="am-icon-home">首页</a></li>
        <li><a href="Admin_Poll.aspx">投票管理</a></li>
        <li class="am-active">编辑投票</li>
        </ol>
        <div class="tpl-portlet-components">
            <div class="am-g tpl-amazeui-form">
                <div class="am-form am-form-horizontal">
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">投票标题：</label>
                        <div class="am-u-sm-9">
                            <input name="VoteTitleTxtEdit" type="text" id="VoteTitleTxtEdit" style="width:80%;float:left;" placeholder="标题" runat="server">
                            <asp:RequiredFieldValidator ID="VoteTitleValREdit" runat="server" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">投票设置：</label>
                        <div class="am-u-sm-9">
                            <div class="input-icon right" style="font-size:14px;margin-top:10px;">
                                <asp:CheckBox ID="MultipleChkEdit" runat="server" Text="多选" />
                                <asp:CheckBox ID="InIndexChkEdit" runat="server" Text="在首页显示" />
                                <asp:CheckBox ID="CanViewChkEdit" runat="server" Text="公开投票结果" />
                                        
                            </div>

                        </div>
                    </div>
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label" style="color:darkred;">注意：</label>
                        <div class="am-u-sm-9">
                            <div style="width:80%;float:left;margin-top:6px;color:darkred;">
                                <small>投票项目（每行为一项，最大255字）</small>
                            </div>
                        </div>
                    </div>
                            
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">投票项目：</label>
                        <div class="am-u-sm-9">
                            <textarea  name="VoteItemsTxtEdit" id="VoteItemsTxtEdit" style="width:90%;float:left;" rows="5" placeholder="每行为一项，最大255字" runat="server"></textarea>
                            <asp:RequiredFieldValidator ID="VoteItemsValREdit" runat="server" ErrorMessage="*" Display="Dynamic"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    
                    <div class="am-form-group">
                        <div class="am-u-sm-9 am-u-sm-push-3">
                            <asp:Button ID="PollEditBtn" CssClass="am-btn am-btn-primary tpl-btn-bg-color-success" runat="server" OnClick="PollEditBtn_Click" Text="修改"/>
                        </div>
                    </div>

                    <div class="am-text-danger" style="font-size:14px;margin-top: 10px; width: 100%; text-align: center">
				        投票信息
			        </div>
                    <div class="tpl-echarts tpl-chart-mb" id="tpl-echarts-A"></div>
                    <div class="am-text-danger" style="font-size:14px;margin-top: 10px; width: 100%; text-align: center">
				        总投票数：<%= VoteSum %>
			        </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        // 基于准备好的dom，初始化echarts图表
        var echartsA = echarts.init(document.getElementById('tpl-echarts-A'));
        option = {
            color: ['#3398DB'],
            tooltip: {
                trigger: 'axis',
                axisPointer: {            // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                }
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            xAxis: [
                {
                    type: 'category',
                    data: [<%=VoteItems %>],
                    axisTick: {
                        alignWithLabel: true
                    }
                }
            ],
            yAxis: [
                {
                    type: 'value'
                }
            ],
            series: [
                {
                    name: '投票数',
                    type: 'bar',
                    barWidth: '60%',
                    data: [<%=VoteDatas %>]
                }
            ]
        };
        echartsA.setOption(option); 
    </script>

</asp:Panel>
</form>
</asp:Content>
